#include "barackapp.h"
#include <QApplication>
#include <QDir>
#include <QFile>
#include <QDebug>

BarackApp::BarackApp()
{


}


QString BarackApp::FindDatabaseFile(void)
{
    QStringList filepathList;
    QString path;
    QDir dir;
    path=dir.currentPath();

    path+="/../trunk/db/BallData.db";
    //qDebug() << "path :" << path;


    QString file= QCoreApplication::applicationDirPath();
    file += "/../trunk/db/BallData.db";

    filepathList << "../trunk/db/BallData.db"  << path << file;

    qDebug() << "filepathList :" << filepathList;


    QString str;


    foreach(str,filepathList)
    {
        if (QFile(str).exists())
        {
            return str;
            break;
        }
    }
    return QString("");

}
